/** @author: duanhaijiao  @date 2022/7/9--20:55 **/

/* name: "singlePage" */
<template>
    <div class="singlePage" v-html="detailInfo">
    </div>
</template>

<script>
    import {home} from '@/assets/api/api.js'
    export default {
        name: "singlePage",
        data() {
            return {
                detailInfo:''
            }
        },
        mounted() {
            console.log(this.$route.query.type)
			this.init();
        },
		watch: {
			$route(to, from) {
				this.init()
			}
		},
        methods: {
			init() {
				if (this.$route.query.type) {
					this.getData(home.activityindex, { id: this.$route.query.id })
				} else {
					console.log(1);
					this.getData(home.wydetail, {
						name: 'bmnew'
					})
				}
			},
            getData(url,data={}){
                this.$http(url,data).then((res)=>{
                    this.detailInfo = this.$route.query.type ? res.data.content : res.data
                })
            },
        }
    };
</script>

<style lang="scss">
.singlePage{
    padding: 30px 0;
}
</style>
